package bootstrap

import (
	"github.com/gin-gonic/gin"
	"go_anime_picture_api/routers"
	"go_anime_picture_api/services"
)

func Run() {

	engine := gin.New()
	engine.Use(gin.Recovery())
	engine.Use(gin.Logger())

	// 构建数据库（暂时用list代替）
	services.BuildPicInfos()

	// 构建路由
	routers.Setup(engine)

	// 启动
	err := engine.Run(":5053")
	if err != nil {
		panic("启动失败")
	}

}
